<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件的添加</title>
		<script>
			var ar=["aa","bb","cc"];
			//ar.forEach((a)=>{alert(a);});
			ar.forEach(function(a){
				alert(a);
			});
		</script>
	</head>
	<body>
		<button type="button" id="btn">点击我</button>
		<button type="button" id="btn1">点击我</button>
		<button type="button" id="btn2">点击我</button>
		<button type="button" id="btn3">点击我</button>
		<script>
			 document.getElementById("btn").onclick=function(){
			 	alert("点击了按钮");
			 };
			 var ar=document.getElementsByTagName("button");
			 console.log(typeof(ar));
			 console.log(ar); 
		</script>
		
	</body>
</html>